home *** CD-ROM | disk | FTP | other *** search
/ PC-X 1997 October / pcx14_9710.iso / swag / delphi.swg / 0225_Re: Registry Editing.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-03-04  |  580 b   |  22 lines

  1.  
  2. procedure AddSourceToRegistry;
  3.  
  4. var
  5.   NTReg           : TRegIniFile;
  6.   dwData          : DWord;
  7. begin
  8.   NTReg := TRegIniFile.Create('');
  9. try
  10.   NTReg.RootKey := HKEY_LOCAL_MACHINE;
  11.   NTReg.OpenKey('SYSTEM\CurrentControlSet\Services\EventLog\Application\MyLog',true);
  12.   NTReg.LazyWrite := false;
  13.   TRegistry(NTReg).WriteString('EventMessageFile',Application.ExeName);
  14.   dwData := EVENTLOG_ERROR_TYPE or EVENTLOG_WARNING_TYPE or
  15.             EVENTLOG_INFORMATION_TYPE;
  16.   TRegistry(NTReg).WriteInteger('TypesSupported', dwData);
  17.  
  18. finally
  19.   NTReg.Free;
  20. end;
  21. end;
  22.